package cn.orangeframe.neon.application.tasks;

import cn.orangeframe.neon.application.run.WorkflowExecutor;
import cn.orangeframe.neon.domain.enums.TaskStatus;
import cn.orangeframe.neon.domain.enums.TaskType;
import cn.orangeframe.neon.domain.model.TaskModel;
import cn.orangeframe.neon.domain.model.WorkflowModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class Switch extends WorkflowSystemTask {

    public Switch() {
        super(TaskType.TASK_TYPE_SWITCH);
    }

    @Override
    public void execute(WorkflowModel workflow, TaskModel task, WorkflowExecutor executor) {
        log.info("Executing switch task: {},{}", task.getTaskReferenceName(), task.getTaskId());
        task.setStatus(TaskStatus.COMPLETED);
    }
}
